import UploadFile from './index.vue'

/**
 * 验证文件是否所有上传完成的表单规则
 * @param isFinished
 * @returns
 */
function validateFileUploaded(isFinished: Ref<boolean>) {
  return {
    validator: (rule: any, value: any, callback: any) => {
      if (!isFinished.value) callback(new Error('文件还在上传中，请稍等上传完成后再点击确定'))
      callback()
    },
    trigger: 'change',
  }
}

export { UploadFile, validateFileUploaded }
